import React from 'react'
// import { connect } from 'umi';
// import { connect } from 'dva';
import { connect, request } from 'umi'

// import user from '../../models/user'
const userTpl = (props: any) => {
    return (
        <div onClick={() => {
            request('/api/users', {
                params: {
                    name: 1,
                }
            }).then((result) => {
                console.log(result)
            })

            // props.dispatch({
            //     type: "user/change"
            // });
        }}>{props.user?.username}</div >
    )
}
export default connect(({ user }: { user: any }) => ({ user }))(userTpl)